package com.zpl.order.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zpl.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel(value = "地址", description = "地址实体")
@TableName("address")
public class Address extends BaseEntity {
    @ApiModelProperty(value = "会员id", required = true)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @TableField(value="member_id")
    private Long memberId;
    @ApiModelProperty(value = "收货人姓名", required = true)
    @TableField(value="receiver_name")
    private String receiverName;
    @ApiModelProperty(value = "收货人手机号", required = true)
    @TableField(value="receiver_mobile")
    private String receiverMobile;
    @ApiModelProperty(value = "省份", required = true)
    @TableField(value="receiver_province")
    private String receiverProvince;
    @ApiModelProperty(value = "城市", required = true)
    @TableField(value="receiver_city")
    private String receiverCity;
    @ApiModelProperty(value = "区县", required = true)
    @TableField(value="receiver_district")
    private String receiverDistrict;
    @ApiModelProperty(value = "详细地址", required = true)
    @TableField(value="receiver_zip")
    private String receiverZip;
    @ApiModelProperty(value = "是否默认地址", required = true)
    @TableField(value="default_address")
    private int defaultAddress;

    public String adressToString(){
        return this.receiverProvince+this.receiverDistrict+this.receiverCity+this.receiverZip;
    }
}
